<?php

namespace Tasker\Models\Calendar;

class Week extends \Nette\Object
{

	public $weekNumber = 0;
	public $days = array();
	private $startDate;

	public function __construct($startDate, $events)
	{
		$this->startDate = $startDate;
		$this->weekNumber = date('W', $startDate);
		for ($i = 0; $i < 7; $i++)
		{
			$dayStart = strtotime('+' . $i . 'days', $startDate);
			$this->days[$i] = new Day($dayStart, isset($events[$dayStart]) ? $events[$dayStart] : array());
		}
	}
}
